/*
 * IPhysicsEngine.h
 *
 *  Created on: 06.01.2012
 *      Author: Kirill Blinov
 *      Copyright: LGPL
 */

#ifndef IPHYSICSENGINE_H_
#define IPHYSICSENGINE_H_

#include <btBulletDynamicsCommon.h>
#include "IPhysicsObject.h"

class IPhysicsEngine
{
private:
	IPhysicsEngine(){};
	IPhysicsEngine( glm::vec3 FirstWorldCorner, glm::vec3 SecondWorldCorner, glm::vec3 Gravity );

protected:
    btDiscreteDynamicsWorld         *dynamicsWorld;
    btDefaultCollisionConfiguration *collisionConfiguration;
    btAxisSweep3                    *axisSweep;

protected:

   static const int MAX_ENGINE_OBJECT_HANDLERS = 1024;

public:
	virtual ~IPhysicsEngine();

	virtual void AddPhisicsObject( IPhysicsObject& ) = 0;
	virtual void RemovePhisicsObject( IPhysicsObject& ) = 0;
	virtual void StepSimulate();
};

class CCommonBulletBasedEngine: public IPhysicsEngine
{
private:
	CCommonBulletBasedEngine(){};

public:
	CCommonBulletBasedEngine( glm::vec3 FirstWorldCorner, glm::vec3 SecondWorldCorner, glm::vec3 Gravity );
	virtual ~CCommonBulletBasedEngine();

	void AddPhisicsObject( IPhysicsObject& Object );
	void RemovePhisicsObject( IPhysicsObject& Object );
	void StepSimulate();
};
#endif /* IPHYSICSENGINE_H_ */

